<%@ page language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%@ include file="../common/common.jsp" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>${menu_name }</title>
</head>
<link href="${ctx }/static/plugins/chosen_v1.6.2/chosen.css" rel="stylesheet" />
<body <%@ include file="../common/skin.jsp" %>>
	<%@ include file="../common/head.jsp" %>
    <%@ include file="../common/menu.jsp" %>
    <div class="J_content">
		<div class="mt20 plr20">
		  <form action="${ctx }/volunteer/list" id="queryForm" method="post">
	        <div class="J_toolsBar clearfix">
				<div class="t_label">名称</div>
				<div class="t_text ml10">
                	<input placeholder="请输入名称" type="text" name="userName" id="userName" value="${userQueryDTO.userName }"/>
                </div>
                <div class="t_button mgl30">
               		<a class="abtn red" href="javascript:myQuery();">
               		   <i class="icon"></i>查询
               		</a>
               	</div>
               	<div class="t_button ml10">
               		<a class="abtn maxblue" href="javascript:myExport();">
               			<i class="icon"></i>导出
               		</a>
               	</div>
               	<div class="t_label ml10">
					记录数：<label style="color: red;" id="total">${page.totalCount }</label>
				</div>
			</div>
			
			<div class="J_table mt20">
                 <div class="t_table">
                     <table>
                         <thead>
                             <tr>
                                 <td>
                                     <span>序号</span>
                                 </td>
                                 <td>
                                     <span>名称</span>
                                 </td>
                                 <td>
                                     <span>姓别</span>
                                 </td>
                                 <td>
                                     <span>身份证号</span>
                                 </td>
                                 <td>
                                     <span>工作单位/就读学校</span>
                                 </td>
                                 <td>
                                 	 <span>联系电话</span>
                                 </td> 
                                 <td>
                                 	 <span>Email</span>
                                 </td>
                                 <td>
                                     <span>微信</span>
                                 </td>
                                 <td>
                                     <span>创建时间</span>
                                 </td>
                             </tr>
                         </thead>
                         <tbody>
                            <c:choose>
                              <c:when test="${page.list != null && page.totalCount > 0 }">
                                 <c:forEach items="${page.list }" var="u" varStatus="status">
		                             <tr>
		                                 <td>
		                                     <div class="t_text tc">
		                                        ${status.index+1 }
		                                     </div>
		                                 </td>
		                                 <td>
		                                     <div class="t_text tc">
                                                     ${u.name }
		                                     </div>
		                                 </td>
		                                 <td>
		                                     <div class="t_text tc">
                                                     ${u.sex }
		                                     </div>
		                                 </td>
		                                 <td>
		                                     <div class="t_text tc">
                                                     ${u.identityCard }
		                                     </div>
		                                 </td>
		                                 <td>
		                                     <div class="t_text tc">
                                                     ${u.company }
		                                     </div>
		                                 </td>
		                                 <td>
		                                 	<div class="t_text tc">
                                                    ${u.mobile }
		                                 	</div>
		                                 </td>
		                                 <td>
		                                     <div class="t_link">
                                                     ${u.email }
		                                     </div>
		                                 </td>
                                         <td>
                                             <div class="t_link">
                                                     ${u.wechat }
                                             </div>
                                         </td>
                                         <td>
                                             <div class="t_text tc">
                                                 <fmt:formatDate value="${u.createDate }" pattern="yyyy-MM-dd HH:mm:ss"/>
                                             </div>
                                         </td>
		                             </tr>
	                             </c:forEach>
                              </c:when>
                              <c:otherwise>
                                  <tr>
                                    <td colspan="9">
	                                  <div class="J_null mt40">
								            <img src="${ctx }/static/images/null.png">
								            <p>暂无相关数据</p>
								      </div>
								    </td>
							      </tr>
                              </c:otherwise>
                            </c:choose>
                         </tbody>
                     </table>
                 </div>
                 <%@ include file="../common/pager.jsp"%>
             </div>
            </form>
		</div>
    </div>
<script src="${ctx }/static/plugins/chosen_v1.6.2/chosen.jquery.js"></script>    
<script type="text/javascript">
	function myQuery(){
		$('#queryForm').submit();
	}
	
	function myExport(){
		var userName = $("#userName").val();
		window.location.href="${ctx}/volunteer/export?userName="+userName;
	}
</script>
</body>
</html>